local zhuiyu = fk.CreateSkill {
  name = "ls__zhuiyu",
}

Fk:loadTranslationTable{
  ["ls__zhuiyu"] = "坠羽",
  [":ls__zhuiyu"] = "当其他角色于其回合外使用牌时，你可弃置一张手牌，取消之所有目标。",
  ["#ls__zhuiyu-cancel"] = "坠羽：你可弃置一张手牌，取消 %src 使用 %arg",

  ["$ls__zhuiyu1"] = "进入埋伏，倒要看你如何脱身。",
  ["$ls__zhuiyu2"] = "谅你肋生双翅，也逃不出这天罗地网。",
}

zhuiyu:addEffect(fk.CardUsing, {
  anim_type = "control",
  can_trigger = function(self, event, target, player, data)
    local current = player.room.current
    return player:hasSkill(zhuiyu.name) and target ~= player and player.room.current ~= target and not player:isNude()
  end,
  on_cost = function(self, event, target, player, data)
    local result = player.room:askToDiscard(player, {
      min_num = 1,
      max_num = 1,
      include_equip = false,
      skill_name = zhuiyu.name,
      cancelable = true,
      prompt = "#ls__zhuiyu-cancel:"..target.id.."::"..data.card:toLogString(),
    })
    return #result > 0
  end,
  on_use = function(self, event, target, player, data)
    data.toCard = nil
    data:removeAllTargets()
  end,
})

return zhuiyu
